package com.engiu.test.client.dialog;
import com.engiu.test.client.CustomTextProgressBar;
import com.engiu.test.client.ProgressBar;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.Widget;


public class SolidProgressBar extends Composite implements ProgressBarInterface {

	@UiField 
	protected DialogBox dialogBox;
	
	@UiField
	protected CustomTextProgressBar progressBar3;
	
	@Override
	public void show() {
		// TODO Auto-generated method stub
		dialogBox.show();
	}


	@Override
	public ProgressBar getProgressBar() {
		// TODO Auto-generated method stub
		return progressBar3;
	}

	private static SolidProgressBarUiBinder uiBinder = GWT
			.create(SolidProgressBarUiBinder.class);

	interface SolidProgressBarUiBinder extends
			UiBinder<Widget, SolidProgressBar> {
	}

	public SolidProgressBar() {
		initWidget(uiBinder.createAndBindUi(this));
		dialogBox.setAnimationEnabled(true);
		dialogBox.setAutoHideEnabled(false);
		dialogBox.setModal(false);
		progressBar3.setWidth("95%");
	}


	public SolidProgressBar(String firstName) {
		initWidget(uiBinder.createAndBindUi(this));
	}

	@UiHandler("okButton")
	void onOkButtonClick(ClickEvent event) {
		dialogBox.hide();
	}
}
